﻿@{
    ViewBag.Title = "商品搜索";
    Layout = "~/Views/Shared/_MallLayout.cshtml";
}
<body class="page-index page-search">
    <!--header end-->
    <form action="javascript:void(0);">
        <div class="lt-search">
            <div class="search search2">
                <div class="box">
                    <input class="searchInput" type="search" placeholder="请输入需要搜索的商品" id="keyword" autocomplete="off">
                    <span class="right">
                        <i class="line"></i>
                        <a href="#" class="contactUs">
                            <i class="icon-search"></i>
                        </a>
                    </span>
                </div>
            </div>
            @*<div class="history">
                    <div class="box">
                        <div class="top">
                            <a href="javascript:;" class="fn-right">
                                <i class="icon-delete"></i>
                            </a>
                            <span class="fn28">搜索历史</span>
                        </div>
                        <div class="content">
                            <a href="#" class="item">女装</a>
                            <a href="#" class="item">dsfsdf</a>
                            <a href="#" class="item">sdfsdf</a>
                            <a href="#" class="item">女dsfgsfdgdfg装</a>
                            <a href="#" class="item">女sdgsfd装</a>
                        </div>
                    </div>
                </div>*@
        </div>
    </form>
    <script>
        $(function () {
            $("#keyword").focus();
        });
        $("#keyword").keyup(function (event) {
            if (event.keyCode == 13) {
                keyword = $("#keyword").val();
                if (keyword.length > 0) {
                    document.activeElement.blur();
                    location.href = '/BazaarProduct/SearchResult?keyword=' + keyword;
                }
            }
        });
        $("#keyword").blur(function () {
            keyword = $("#keyword").val();
            if (keyword.length > 0) {
                document.activeElement.blur();
                location.href = '/BazaarProduct/SearchResult?keyword=' + keyword;
            }
        });
        $(".contactUs").click(function () {
            keyword = $("#keyword").val();
            if (keyword.length > 0) { location.href = '/BazaarProduct/SearchResult?keyword=' + keyword; }
        })
    </script>
</body>



